﻿@model WebEditor.Models.FileUpload

@section scripts {
    <script src="@Url.Content("~/Scripts/FileUpload.js")" type="text/javascript"></script>
}

<!DOCTYPE html>

<html>
<head>
    <title>File Upload</title>
    <style>
        body { background-color: transparent; }
    </style>
</head>
<body>
    <form action="" method="post" enctype="multipart/form-data" id="file-upload-form">
        @Html.HiddenFor(m => m.GameId)
        @Html.HiddenFor(m => m.Key)
        @Html.HiddenFor(m => m.Attribute)
        @Html.HiddenFor(m => m.AllFiles)
        @Html.HiddenFor(m => m.PostedFile)
        <div id="file-upload-existing" style="display: none">
            <p class="file-upload-header">Choose an existing file:</p>
            <select id="existingFiles" style="max-width:200px;"></select>
            <div id="file-upload-imgPreview"></div>
        </div>
        <div id="file-upload-new">
            <p id="file-upload-new-header" class="file-upload-header" style="display:none">Or upload a new file:</p>
            @Html.ValidationMessageFor(m => m.File)
            <span id="file-upload-new-error"></span>
            <input type="file" name="File" id="File" />
        </div>
        <button id="file-upload-submit" type="submit" style="display: none">Upload</button>
    </form>
</body>
</html>
